package com.lizardmind.haofudoctor.ui.studio.sickEducation

import android.os.Bundle
import android.view.View
import com.linxiao.framework.activity.BaseActivity
import com.linxiao.framework.util.color
import com.linxiao.framework.util.getBaseFragmentStatePagerAdapter
import com.linxiao.framework.util.getDataBinding
import com.linxiao.framework.widget.NavigationView
import com.lizardmind.haofudoctor.R
import com.lizardmind.haofudoctor.databinding.ActivitySystemSickEduBinding
import kotlinx.android.synthetic.main.activity_system_sick_edu.*
import kotlinx.android.synthetic.main.include_title_text.*

class SystemSickEduActivity : BaseActivity() {
    private val listFragment= arrayListOf(SystemEduFragment.getInstance(1),SystemEduFragment.getInstance(2),SystemEduFragment.getInstance(3))

    val binding by lazy { getDataBinding<ActivitySystemSickEduBinding>(R.layout.activity_system_sick_edu) }
    override fun onCreatRootView(): View {
        return  binding.root
    }

    override fun onInitView(savedInstanceState: Bundle?) {
        binding.apply {
            VPager_SystemEdu.setScanScroll(true)
            VPager_SystemEdu.adapter= getBaseFragmentStatePagerAdapter(supportFragmentManager,listFragment)
            naView_SystemEdu.binding(VPager_SystemEdu)
                    .setTextViewChildTextFromString(resources.getStringArray(R.array.systemEdu))
                    .setUnSelectTextColor(color(R.color.gray3))
                    .setSelectTextColor(color(R.color.notice_red))
                    .setTextSize(16f)//文字大小，单位为sp，默认为42px
                    .setSlidingStripPosition(NavigationView.BOTTOM)
                    .setScllorHeight(2f)
                    .setScllorColor(color(R.color.notice_red))
                    .commit()//提交，执行修改
        }

        titleText.text="系统教育库"

        imgLeft.setImageResource(R.mipmap.back)
        imgLeft.setOnClickListener {
            finish()
        }
    }
}
